import {createMemoryHistory, createRouter, createWebHistory} from 'vue-router'
import Login from "@/components/Login.vue";
import Home from "@/components/Home.vue";
import Manager from "@/components/Manager.vue";
import Book from "@/components/Book.vue";
import Info from "@/components/Info.vue";
import SystemHome from "@/components/SystemHome.vue";
// 路由的数组
// path路径
// component 组件的实例
// alt+enter导包
//name
// "/"这是默认的路径
const routes = [
    { path: '/', component: Login, name: 'login' },
    {
        path: '/manager', component: Manager, name: 'manager', children: [
            // 子路由器不能有”/“
            { path: 'book', component: Book, name: 'book' },
            { path: 'info', component: Info, name: 'info' },
            { path: 'home', component: Home, name: 'home' },
            //默认路由
            { path: 'systemHome', component: SystemHome, name: 'systemHome' },

        ]
    },
]

export const router= createRouter({
    history: createWebHistory(),
    routes,
})